import { connect } from 'react-redux'
import FillOrder from '../../../views/Shop/FillOrder'

function mapStateToProps(state: any) {
    return {
        userInfo: state.user.userInfo,
        defaultAddress: state.user.defaultAddress
    }
}

function mapDispatchToProps(dispatch: (obj: any) => void) {
    return {
        'SET_DETAIL_DATA': (data: any) => {
            dispatch({ type: 'SET_DETAIL_DATA', data })
        },
        'SET_DETAIL_ADDRESS': (data: any) => {
            dispatch({ type: 'SET_DETAIL_ADDRESS', data })
        },
        'SET_DETAIL_SPEC': (data: any) => {
            dispatch({ type: 'SET_DETAIL_SPEC', data })
        },
        'SET_USER_DEFAULT_ADDRESS': (data: any) => {
            dispatch({ type: 'SET_USER_DEFAULT_ADDRESS', data })
        },
        'SET_BEANS_ORDER': (data: any) => {
            dispatch({ type: 'SET_BEANS_ORDER', data })
        }
    }
}

export default connect(mapStateToProps, mapDispatchToProps)(FillOrder)